package com.dylan.channel.v11.future;

import com.dylan.channel.v11.channel.Channel;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

public interface ChannelPromise extends ChannelFuture, Promise<Void> {
    @Override
    Channel channel();

    @Override
    ChannelPromise sync();

    @Override
    boolean await(long timeout, TimeUnit unit) throws InterruptedException;


    @Override
    Promise<Void> setSuccess(Void result);

    @Override
    Promise<Void> setSuccess();
    @Override
    Promise<Void> await();

    @Override
    boolean cancel(boolean mayInterruptIfRunning);

    @Override
    boolean isCancelled();

    @Override
    boolean isDone();

    @Override
    Void get() throws InterruptedException, ExecutionException;

    @Override
    Void get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException;
}
